# -*- coding: utf-8 -*- 
# @Time : 2021/10/19 21:43 
# @Author : Dong 
# @File : __init__.py

from flask import Blueprint
from flask_restful import Api

from ihome.api_1_0.houses import Area_infor, House_infor,House_image,House_index,House_infor_id,Landlord_house
from .verify_code import VerifyCode,Get_sms_code
from ihome.api_1_0.passport import Register,Login,Check_login
from ihome.api_1_0.profile import Set_user_avatar
from ihome.api_1_0.user_infor import UserInfor, User_real_name

api = Blueprint('api_1_0',__name__)
user_api = Api(api)

user_api.add_resource(VerifyCode, '/image_codes/<image_code_id>')
user_api.add_resource(Get_sms_code,'/sms_codes/<re(r"1[3-8]\d{9}"):mobile>')
                                    #        "/<re(r'.*'):file_name>"
user_api.add_resource(Register,'/users')
user_api.add_resource(Login,'/login')
user_api.add_resource(Check_login,'/session')
user_api.add_resource(Set_user_avatar,'/avatar')
user_api.add_resource(UserInfor,'/user')
user_api.add_resource(Area_infor,'/areas')
user_api.add_resource(User_real_name,'/user/auth')
user_api.add_resource(House_infor,'/houses/info')
user_api.add_resource(House_image,'/houses/image')
user_api.add_resource(House_index,'/houses/index')
user_api.add_resource(House_infor_id,'/houses/<int:house_id>')
user_api.add_resource(Landlord_house,'/user/houses')

